<template>
	<view class="p">
		<view class="confirm-dialog">
			<view class="title">
				{{ title }}
			</view>
			<view class="content">
				<slot></slot>
			</view>
			<view class="foot">
				<view class="back" @click="cancelBack">
					{{ cancel }}
				</view>
				<view class="confirm" @click="confirmOk">
					{{ confirm }}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"ConfirmDialog",
		props:{
			title:{
				type:String,			
				default:'标题'
			},
			cancel:{
				type:String,			
				default:'取消'
			},
			confirm:{
				type:String,			
				default:'确定'
			}
		},
		// props:['title'],/
		data() {
			return {
				
			};
		},
		methods:{
			cancelBack(){
				this.$emit('cancelBack')
			},
			confirmOk(){
				this.$emit('confirmOk')
				
			}
		}
	}
</script>

<style lang="scss">
	.p{
		width: 100vw;
		height: 100vh;
		// display: flex;
		// flex-direction: column;
		// justify-content: center;
		// align-items: center;
		z-index: 999;
		position: fixed;
		top: 50%;
		right: 0;
		margin-top: -50%;
		// border: 1px solid #000;
	}
.confirm-dialog{
	width: 95%;
	
	background: #fff;
	margin: 0 auto;
	border-radius: 10rpx;
	.title{
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		
	}
	.content{
		
	}
	.foot{
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		display: flex;
		font-weight: bold;
		.back{
			flex: 1;
			text-align: center;
			border-top: 1px solid #ccc;
			border-right: 1px solid #ccc;
			
		}
		.confirm{
			flex: 1;
			text-align: center;
			border-top: 1px solid #ccc;
			color: #00f;
		}
	}
}
</style>